package prisd.brand.com.base64.application;

import android.app.Application;
import android.support.annotation.Nullable;

import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.LogcatLogStrategy;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;

public class MyApp extends Application {
    final String LOG_TAG = "HJ";//日志的 TAG 值
    final boolean LOGGABLE = true;//是否开启日志打印
    @Override
    public void onCreate() {
        super.onCreate();
        Logger.addLogAdapter(new AndroidLogAdapter(PrettyFormatStrategy.newBuilder()
                //是否显示线程信息
                .showThreadInfo(true)
                //显示方法的数量
                .methodCount(1)
                .methodOffset(0)
                .logStrategy(new LogcatLogStrategy())
                .tag(LOG_TAG)
                .build()) {

            @Override
            public boolean isLoggable(int priority, @Nullable String tag) {
                //是否开启日志打印
                return LOGGABLE;
            }
        });
    }
}